<template>
  <div>
    <!--头部-->
    <home-header1 ></home-header1>
    <!--//轮播图-->
    <home-swiper :list="swiperList"></home-swiper>
    <!--九宫格-->
    <home-icons :list="iconsList"></home-icons>
    <!--热门榜单-->
    <home-recommed :list="recommedList" :hotlist="hotList"></home-recommed>
    <!--周末推荐-->
    <home-weekend :list="weekList"></home-weekend>
    <!--底部-->
    <home-bottom></home-bottom>
  </div>
</template>

<script>
import HomeHeader1 from './component/Header1.vue'
import HomeSwiper from './component/Swiper'
import HomeIcons from './component/icons'
import HomeRecommed from './component/recommed'
import HomeWeekend from './component/weekendplay'
import HomeBottom from './component/bottom'
import axios from 'axios'
export default {
  name: 'Home',
  data () {
    return {
      swiperList: [],
      iconsList: [],
      recommedList: [],
      hotList: [],
      weekList:[]
    }
  },
  components: {
    HomeHeader1,
    HomeSwiper,
    HomeIcons,
    HomeRecommed,
    HomeWeekend,
    HomeBottom
  },
  methods : {
    getHomeInfo () {
      axios.get('/static/homemessage/index.json').then(this.getHomeInfoSucc)
    },
    getHomeInfoSucc (res) {
      var body = res.data;
      if (body.ret && body.data){
            this.swiperList = body.data.swiperList;
            this.iconsList = body.data.iconsList;
            this.recommedList = body.data.recommedList;
            this.hotList = body.data.hotList;
            this.weekList = body.data.weekList;
      }
    }
  },
  mounted () {
    this.getHomeInfo();
  }
}
</script>

<style scoped>

</style>
